package com.cnap.multiclouldmgmt.util;

import com.cnap.multiclouldmgmt.MulticlouldmgmtApplicationTests;
import org.junit.jupiter.api.Test;

import java.text.ParseException;
import java.util.Date;

import static org.junit.jupiter.api.Assertions.*;

class DateUtilsTest extends MulticlouldmgmtApplicationTests {

    public static final String newDate ="2022-12-02T11:11:11";
    public static final String oldDate ="2022-12-02T01:11:11";


    @Test
    void countSecondsBetweenTwoDate() throws ParseException {


        DateUtils.countSecondsBetweenTwoDate(newDate,oldDate);
    }

    @Test
    void changeDateToTZ() {

        DateUtils.changeDateToTZ(new Date());
    }

    @Test
    void countTimeBetweenNow() throws ParseException {

        String time = "2022-12-01T11:11:11";
        DateUtils.countTimeBetweenNow(time);
    }

    @Test
    void changeDateFormatYYYYMMDD() throws ParseException {
        String time = "2022-01-12";
        DateUtils.changeDateFormatYYYYMMDD(time);
        DateUtils.changeDateFormatYYYYMMDD(null);
    }

    @Test
    void getDateByYYMMDDTHHMMSS() throws ParseException {
        String time = "2022-01-12T01:01:01";
        DateUtils.getDateByYYMMDDTHHMMSS(null);
        DateUtils.getDateByYYMMDDTHHMMSS(time);
    }

    @Test
    void changeDateFormatMMDD() throws ParseException {

        DateUtils.changeDateFormatMMDD(null);
        DateUtils.changeDateFormatMMDD(new Date());
    }

    @Test
    void changeDateFormatYYYYMMDDHHMMSS() {

        DateUtils.changeDateFormatYYYYMMDDHHMMSS(new Date());
        DateUtils.changeDateFormatYYYYMMDDHHMMSS(null);
    }

    @Test
    void changeDateFormatYYYYMMDDHHMM() {
        DateUtils.changeDateFormatYYYYMMDDHHMM(null);
        DateUtils.changeDateFormatYYYYMMDDHHMM(new Date());
    }
}